<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<form id="form_task_feedback" class="panel-body form-horizontal form-padding">
    <input type="hidden" name="taskId" id="taskId" value="${taskId}"/>
    <div class="form-group">
        <label class="col-md-2 control-label">完成程度<i class="fa fa-asterisk txt-color-red"></i></label>
        <div class="col-md-10">
            <div class="input-group">
                <div class="radio">
                    <!-- Inline radio buttons -->
                    <input type="radio" name="completeLevel" id="level1Selected" class="magic-radio" value="1">
                    <label for="level1Selected">全部完成</label>

                    <input type="radio" name="completeLevel" id="level2Selected" class="magic-radio" value="0" checked="checked">
                    <label for="level2Selected">部分完成</label>

                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-2 control-label">任务反馈内容<i class="fa fa-asterisk txt-color-red"></i></label>
        <div class="col-md-10">
            <input type="text" id="feedbackContent" name="feedbackContent" class="form-control">
        </div>
    </div>
    <div class="form-group">
        <label class="col-md-2 control-label">相关附件</label>
        <div class="col-md-10">
            <input name="uploadify" id="fileFeedback" placeholder="" type="file">
            <input name="hiddenFiles" id="hiddenFilesFeedback" type="hidden">
        </div>
    </div>
</form>

<script>

    // 附件上传
    inputLoad({
        objId:"fileFeedback",
        entityName:"fileFeedback",
        sourceId:"hiddenFilesFeedback"
    });

    function fn_task_feedback_save(callback) {
        var tmp = $("input#feedbackContent").val();
        if(!tmp){
            __toastr_error("请输入任务反馈内容！");
            return false;
        }

        __form_save('form_task_feedback', '<%=path%>/activiti/taskfeedback/save',
            function(data){
                if(data.state == 1){
                    callback(data.data);
                } else {
                    callback();
                }
            }, function () {
                callback();
            });
    }

</script>
